package com.itkf.core.rejectHandle;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ThreadPoolExecutor;

@Slf4j
public class MyAbortPolicy extends RejectHandle{
    @Override
    public String Mark() {
        return "abort";
    }

    @Override
    public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
          log.error("线程池启用默认拒绝策略");
          throw new RuntimeException("拒绝线程加入");
    }
}
